﻿package com.yy.mvc.model{
    import flash.events.*;

    public class ModelData extends EventDispatcher implements IModelData {

        protected var _dataMap:Object;

        public function ModelData(){
            this._dataMap = {};
            super();
        }
        public function sendEvent(_arg1:String, _arg2:Object):void{
            dispatchEvent(new ModelEvent(_arg1, _arg2));
        }
        public function addDataListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
            this.addEventListener(_arg1, _arg2, false, 0, true);
            if (!_arg3){
                return;
            };
            var _local4:Object = this.getData(_arg1);
            if (_local4 != null){
                this.sendEvent(_arg1, _local4);
            };
        }
        public function removeDataListener(_arg1:String, _arg2:Function):void{
            this.removeEventListener(_arg1, _arg2);
        }
        public function setData(_arg1:String, _arg2:Object):Object{
            this._dataMap[_arg1] = _arg2;
            this.sendEvent(_arg1, _arg2);
            return (_arg2);
        }
        public function insertData(_arg1:String, _arg2:Object):Object{
            this._dataMap[_arg1] = _arg2;
            return (_arg2);
        }
        public function getData(_arg1:String):Object{
            return (this._dataMap[_arg1]);
        }
        public function hasData(_arg1:String):Boolean{
            return (this._dataMap.hasOwnProperty(_arg1));
        }

    }
}//package com.fminutes.vinciMVC.model 
